Given \(\mathcal{C}\xrightarrow{F}\mathcal{D}\), the data migration functor \(\Delta_F\) turns \(\mathcal{D}\) instances to \(\mathcal{C}\) instances. This functor has both a left and right adjoint:
Migration Functor | Pronounced | Reminiscent of | Database idea |
---|---|---|---|
\(\Delta\) | Delta | Duplicate or destroy | Duplicate or destroy tables or columns |
\(\Sigma\) | Sigma | Sum | Union (sum up) data |
\(\Pi\) | Pi | Product | Pair and query data |
Consider a functor which discards the distinction between Economy and First Class seats in an airplane.
The \(\Delta\) functor is uninteresting - it will copy the rows for Seat into both Economy and First class.
The functor \(\Pi\) puts into each airline seat only seats which are in both the Economy and First Class tables with the same price and position.
The functor \(\Sigma\) puts all Economy and First Class seats into the Seat table and discards the information of from which table they came from.